package Physics;

import java.util.Vector;


// used to store collision information
public class CollisionData 
{
	// holds the base collision data. 
	//public Contact [] m_contactArray;
	public Vector<Contact> m_contactArray;
	
	// holds the contact array to write into
	public Contact m_contact;

	// holds the max number of contacts
	public int m_contactsLeft;

	// holds the number of contacts found so far
	//public int m_contactCount;

	// holds the frictional value
	public float m_friction;

	// holds the restitutional value
	public float m_restitution;

	// holds the tolerance to objects that aren't really
	// colliding, but should still generate contact information
	//real tolerance;

	public CollisionData()
	{
		m_contactArray = new Vector<Contact>();
	}
	
	// checks if there are more contacts free
	public boolean hasMoreContacts()
	{
		return m_contactsLeft > 0;
	}

	// resets the data
	public void reset(int maxContacts)
	{
		m_contactsLeft = maxContacts;
		//m_contactCount = 0;
		
		m_contactArray.removeAllElements();
	}

	// notified that more contact data has been added
	/*public void addContacts(int count)
	{
		// returns the number of contacts remaining
		m_contactsLeft -= count;
		m_contactCount += count;

		// push the pointer forward
		m_contactArray.;
	}*/
	
	public void addContact(Contact newContact)
	{
		m_contactArray.add(newContact);
	}
}
